package dao

import (
	"1-12zk/inits"
	"1-12zk/models"
)

func AddArticle(article models.Article) error {
	return inits.DB.Debug().Create(&article).Error
}

func List() (artice []models.Article, err error) {
	inits.DB.Debug().Order("like_num desc").Find(&artice)
	return
}
